<?php
namespace app\common\validate;

use think\Validate;

class UserRoleValidate extends Validate{
    protected $rule = [
        'name'=>'require|unique:user_role',    //名称可以相同 因为有分组
    ];

    protected $message = [
        'name.unique'=>'角色名称须唯一',
    ];

    protected $scene = [
        'add' => ['name'],
        'edit'=> ['name'],
    ];
}

